<?php

namespace common\entities\outstock;

use Yii;

/**
 * This is the model class for table "myscrm_delivery_attachment".
 *
 * @property integer $id
 * @property string $file_guid
 * @property string $delivery_guid
 * @property string $path
 * @property string $filename
 * @property string $created_on
 * @property string $created_by
 * @property integer $file_size
 */
class MyscrmDeliveryAttachmentEntity extends \common\entities\ContractEntity
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'myscrm_delivery_attachment';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('contractDB');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['delivery_guid'], 'required'],
            [['created_on'], 'safe'],
            [['file_size'], 'integer'],
            [['file_guid', 'delivery_guid', 'created_by'], 'string', 'max' => 36],
            [['path', 'filename'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'file_guid' => 'File Guid',
            'delivery_guid' => '单据ID',
            'path' => '文件路径',
            'filename' => '文件名',
            'created_on' => '创建时间',
            'created_by' => '创建人',
            'file_size' => 'File Size',
        ];
    }
}
